<?php
/**
 * The following variables are available in this template:
 * - $this: the CrudCode object
 */
?>
<?php echo "<?php\n"; ?>
/* @var $this <?php echo $this->getControllerClass(); ?> */
/* @var $model <?php echo $this->getModelClass(); ?> */
/* @var $form CActiveForm */
?>

<?php echo "<?php \$form=\$this->beginWidget('CActiveForm', array(
	'id'=>'" . $this->class2id($this->modelClass) . "-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array(
        'role' => 'form',
        'class' => 'form-horizontal',
    )
)); ?>\n"; ?>

<p class="note">Fields with <span class="required">*</span> are required.</p>

<?php echo "<?php if (\$model->getErrors()) {
    ?>
    <div class=\"alert alert-error\">
        <button class=\"close\" data-dismiss=\"alert\" type=\"button\"> ×</button>
        <?php echo \$form->errorSummary(\$model); ?>
    </div>
<?php } ?>"?>

<div class="form admin-main-wrapper">
    <div class="block block-themed block-last">
        <div class="block-title">
            <h4></h4>
        </div>
        <div class="block-content">
            <?php
            foreach ($this->tableSchema->columns as $column) {
                if ($column->autoIncrement)
                    continue;
                ?>
                <div class="row control-group">
                    <?php echo "<?php echo " . $this->generateActiveLabel($this->modelClass, $column, 'control-label') . "; ?>\n"; ?>
                    <div class="controls">
                        <?php echo "<?php echo " . $this->generateActiveField($this->modelClass, $column) . "; ?>\n"; ?>
                    </div>
                </div>

            <?php
            }
            ?>
            <div class="row control-group buttons">
                <div class="controls">
                    <?php echo "<?php echo CHtml::submitButton(\$model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn btn-default')); ?>\n"; ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php echo "<?php \$this->endWidget(); ?>\n"; ?>

